#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Class.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Image;
class Profile;

/// <summary>
/// Stereotype
/// A stereotype defines how an existing metaclass may be extended, and enables the
/// use of platform or domain specific terminology or notation in place of, or in
/// addition to, the ones used for the extended metaclass.
/// </summary>
class UMLMODEL_EXPORT Stereotype : public Class {

public: // Constructors and destructors
    explicit Stereotype(const QString& umlType="uml::Stereotype");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Methods
    /// <summary>
    /// containingProfile
    /// The query containingProfile returns the closest profile directly or indirectly
    /// containing this stereotype.
    /// </summary>
    virtual shared_ptr<Profile> containingProfile() const;

public: // Properties
    /// <summary>
    /// icons getter
    /// Stereotype can change the graphical appearance of the extended model element by
    /// using attached icons. When this association is not null, it references the
    /// location of the icon content to be displayed within diagrams presenting the
    /// extended model elements.
    /// </summary>
    vector<shared_ptr<Image>>& icons();

    /// <summary>
    /// profile getter
    /// The profile that directly or indirectly contains this stereotype.
    /// </summary>
    shared_ptr<Profile> profile() const;

    /// <summary>
    /// profile setter
    /// The profile that directly or indirectly contains this stereotype.
    /// </summary>
    void setProfile(shared_ptr<Profile> value);

private: // Fields
    /// <summary>
    /// icons
    /// Stereotype can change the graphical appearance of the extended model element by
    /// using attached icons. When this association is not null, it references the
    /// location of the icon content to be displayed within diagrams presenting the
    /// extended model elements.
    /// </summary>
    vector<shared_ptr<Image>> icons_;

    /// <summary>
    /// profile
    /// The profile that directly or indirectly contains this stereotype.
    /// </summary>
    shared_ptr<Profile> profile_;

};

} // namespace uml
